<template>
  <span v-if="value">
    <icon-font v-if="value.slice(0, 1) == '#'" :type="value.slice(1)" />
    <a-icon v-else :type="value" />
  </span>
</template>
<script>
import { Icon } from "ant-design-vue"
const IconFont = Icon.createFromIconfontCN({
  scriptUrl: process.env.BASE_URL + "icon/iconfont.js",
})
export default {
  components: {
    IconFont,
  },
  props: {
    value: {
      //这个就是父组件中子标签自定义名字
      type: String,
      default: null,
    },
  },
}
</script>
<style scoped>
.anticon {
  font-size: 1em;
}
</style>
